﻿
@{
    ViewBag.Title = "TotalSalaryIndex";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<script src="~/Content/js/datepicker/WdatePicker.js"></script>
<script src="~/Content/js/dayin/jquery.jqprint-0.3.js"></script>
<script>
    $(function() {
        gridList();
    });

    function gridList() {
        var $gridList = $("#gridList");
        $gridList.dataGrid({
            url: "/Project/Salary/GetGridJsonTotal",
            height: $(window).height() - 96,
            colModel: [
                { label: "主键", name: "Persion_F_Id", hidden: true, key: true },
                //{
                //    label: '序号', name: 'Num', width: 50, align: 'center',
                //    formatter: "date", formatoptions: { srcformat: 'Y-m-d h:i:s', newformat: 'Y-m-d  h:i:s' }
                //},
                //{
                //    label: '班次', name: 'CarriageID', width: 80, align: 'center'
                //},
                {
                    label: '岗位',
                    name: 'Duty',
                    width: 80,
                    align: 'center',
                    formatter: function(cellvalue) {
                        return cellvalue != null ? cellvalue.F_FullName : "未获取到";
                    }
                },
                {
                    label: '姓名',
                    name: 'Worker',
                    width: 100,
                    align: 'center',
                    formatter: function(cellvalue) {
                        return cellvalue != null ? cellvalue.F_RealName : "未获取到";
                    }
                },
                {
                    label: '系数',
                    name: 'Worker',
                    width: 80,
                    align: 'center',
                    formatter: function(cellvalue) {
                        return cellvalue.Gongzixishu != null ? cellvalue.Gongzixishu : " ";
                    }
                },
                {
                    label: '单价',
                    name: 'Worker',
                    width: 80,
                    align: 'center',
                    formatter: function(cellvalue) {
                        return cellvalue.GongziDanjia != null ? cellvalue.GongziDanjia : " ";
                    }
                },
                {
                    label: '应发提成',
                    name: 'NeedToPay',
                    width: 180,
                    align: 'center'
                },
                {
                    label: '备注',
                    name: 'ThingsName',
                    width: 80,
                    align: 'center'
                }
            ],
            pager: "#gridPager",
            sortname: 'F_CreatorTime desc',
            viewrecords: true

        });
        $("#btn_search").click(function() {
            $gridList.jqGrid('setGridParam',
                {
                    postData: {
                        keyword: $("#txt_keyword").val(),
                        StartTime: $("#sTime").val(),
                        EndTime: $("#eTime").val()
                    }
                }).trigger('reloadGrid');
        });
    }

    function btn_details() {
        var keyValue = $("#gridList").jqGridRowValue().Persion_F_Id;
        $.modalOpen({
            id: "Details",
            title: "查看运量详情",
            url: "/Project/Salary/Details?keyValue=" + keyValue,
            width: "1000px",
            height: "720px",
            btn: null
        });
    }

    function preview() {
        $("#gview_gridList").jqprint({
            debug: false, 
            importCSS: false, 
            printContainer: true, 
            operaSupport: true
        });
    }
</script>


<div class="topPanel">
    <div class="toolbar">
        <div class="btn-group">           
            <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
        </div>
        <div class="btn-group">
            @*<a id="NF-add" class="btn btn-primary dropdown-text" onclick="btn_add()"><i class="fa fa-plus"></i>新增股道</a>*@
        </div>
        @*<div class="operate">
            <ul class="nav nav-pills">
                <li class="first">已选中<span>1</span>项</li>
                <li><a id="NF-edit" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>修改运量信息</a></li>
                <li><a id="NF-delete" onclick="btn_delete()"><i class="fa fa-trash-o"></i>删除运量信息</a></li>
                <li><a id="NF-Details" onclick="btn_details()"><i class="fa fa-search-plus"></i>查看运量详情</a></li>
                <li class="split"></li>
            </ul>
            <a href="javascript:;" class="close"></a>
        </div>*@
        <script>$('.toolbar').authorizeButton()</script>
    </div>
    <div class="search">
        <table>
            <tr>
                <td>
                    <div class="input-group" style="padding-left:11px;padding-right:10px;">
                        <input id="txt_keyword" type="text" class="form-control" placeholder="按照人员名称搜索(全名)" style="width: 200px; margin-right:20px;">
                        <input id="sTime" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker()" placeholder="输入开始查询时间" style="width: 200px; margin-right:20px;">
                        <input id="eTime" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker()" placeholder="输入结束查询时间" style="width: 200px; margin-right:20px;">
                        <span class="input-group-btn">
                            <button id="btn_search" type="button" class="btn  btn-primary active"><i class="fa fa-search"></i></button>
                            <button class="btn dayin" onclick="preview()"></button>
                        </span>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</div>
<style>
    table tr td {
        padding-left: 15px;
    }
    .dayin {
        background: url('../../../../Content/js/dayin/dayin.jpg') no-repeat;
        background-size: 100% 100%;
        border-style:none; 
        width:35px!important;
        height: 32px !important;
        margin-left:17px!important;
    }
    .dayin:hover {
        background: url('../../../../Content/js/dayin/dayin.jpg') no-repeat;
        background-size: 100% 100%;
        border-style:none; 
        width:35px!important;
        height: 32px !important;
        margin-left:17px!important;
    }
</style>

<div class="gridPanel">
     <table id="gridList"></table>
    <div id="gridPager"></div>
</div>





